function request(type, data, path) {
    return new Promise(resolve => {
        ajax({
            type,
            data,
            path,
            successCB: res => {
                resolve(res)
            }
        })
    })
}

// function reg(data) {
//     request( data,'get', 'http://192.168.59.230/shopping_cart_PHP/php/login.php')
// }


//注册接口
const register = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/register.php');
//登录接口
const login = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/login.php');

//购物车
const cart = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/cart.php');

//首页加入购物车
const addToCart = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/addToCart.php');

//列表页
const goodList = data => request('get', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/list.php');

//详情页
const Detail_ = data => request('get', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/detail.php');

//删除接口
const del = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/del.php');

//修改接口
const change_ = data => request('post', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/change.php');

//个人中心
const personal = data => request('get', data, 'http://127.0.0.1/mi/%e5%b0%8f%e7%b1%b3/php/personal.php');